package com.huidu.bitrade.vo;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.huidu.bitrade.util.MoneySerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ExchangeOrderExpandDetailVO {

    @ApiModelProperty("价格")
    @JsonSerialize(using = MoneySerializer.class)
    private BigDecimal amount;

    private String amountSymbol;

    @ApiModelProperty("数量")
    @JsonSerialize(using = MoneySerializer.class)
    private BigDecimal number;

    private String numberSymbol;

    @ApiModelProperty("平台币手续费")
    @JsonSerialize(using = MoneySerializer.class)
    private BigDecimal platformFee;

    @ApiModelProperty("从收入代币中扣的手续费")
    @JsonSerialize(using = MoneySerializer.class)
    private BigDecimal incomeFee;

    @ApiModelProperty("收入代币符号")
    private String incomeSymbol;

    @ApiModelProperty("创建时间")
    private Long createTime;

    @JsonIgnore
    @ApiModelProperty(hidden = true)
    private String amountData;

    @JsonIgnore
    @ApiModelProperty(hidden = true)
    private String numberData;

    public void setAmountData(String amountData) {
        String[] split = amountData.split(",");
        amount = new BigDecimal(split[0]);
        amountSymbol = split[1];
    }

    public void setNumberData(String numberData) {
        String[] split = numberData.split(",");
        number = new BigDecimal(split[0]);
        numberSymbol = split[1];
    }
}

